<template>
  <div class="page-container">
    <cm-table
      :filters="filters"
      :filterFields="filterFields"
      :columns="columns"
    ></cm-table>
  </div>
</template>

<script setup>
import {ref} from 'vue';
import date from "@/utils/date";

const filters = ref({
  code: ''
});
// 分页查询条件
const filterFields = ref([
  {prop: "memberName", label: "会员名称"},
  {prop: "code", label: "证券代码"},
  {prop: "startDate", label: "开始时间", type: 'date'},
  {prop: "endDate", label: "结束时间", type: 'date'},
]);
const columns = ref([
  {prop: "memberName", label: "会员名称", minWidth: 100},
  {prop: "accountId", label: "资金账户", minWidth: 100},
  {prop: "createTime", label: "委托时间", width: 150},
  {prop: "code", label: "证券代码", minWidth: 100},
  {prop: "name", label: "证券名称", minWidth: 100},
  {prop: "orderType", label: "买卖标记", minWidth: 100, type: 'dic-value', dicCode: 'dicOrderType'},
  {prop: "status", label: "委托状态", minWidth: 100, type: 'dic-value', dicCode: 'dicStockOrderStatus'},
  {prop: "finished", label: "委托状态", minWidth: 100, formatter: (prop, value) => {
      return value === 1 ? '已成交' : value === 2 ? '废单' : '待成交'
    }
  },
  {prop: "volume", label: "委托数量", minWidth: 100, type: 'number', align: 'right'},
  {prop: "tradedVolume", label: "成交数量", minWidth: 100, type: 'number', align: 'right'},
  {prop: "cancelVolume", label: "已撤数量", minWidth: 100, type: 'number', align: 'right'},
  {prop: "price", label: "委托价格", minWidth: 100, type: 'number', point: 2, align: 'right'},
  {prop: "tradedPrice", label: "成交均价", minWidth: 100, type: 'number', point: 2, align: 'right'},
  {prop: "freezeMoney", label: "冻结金额", minWidth: 100, type: 'number', point: 2, align: 'right'},
  {prop: "freezeCommission", label: "冻结手续费", minWidth: 120, type: 'number', point: 2, align: 'right'},
  {prop: "orderId", label: "订单编号", minWidth: 100},
  {prop: "orderSysId", label: "合同编号", minWidth: 100},
  {prop: "cancelReason", label: "废单原因", minWidth: 100},
  {prop: "createTime", label: "创建时间", width: 160},
]);
</script>